<template>
  <view>
    <u-tabs lineColor="#f56c6c" :list="list" @click="handelCheck" :scrollable="false" lineHeight="5"></u-tabs>
    <view class="content">
      <view class="read">
        <image src="/static/icon_yidu@2x.png"></image>
        <text>全部已读</text>
      </view>
      <public-news v-if="isComponent"></public-news>
      <system-notice v-else></system-notice>
    </view>
  </view>
</template>

<script>
export default {
  name: '',
  components: {},
  data() {
    return {
      list: [
        {
          name: '公告'
        },
        {
          name: '系统通知'
        }
      ],
      isComponent: true,
      news: [],

    }
  },
  async created() {

  },
  mounted() {},
  onLoad() {},
  methods: {
    handelCheck(item) {
      console.log(item)
      if (item.name === '公告') {
        this.isComponent = true
      } else if (item.name === '系统通知') {
        this.isComponent = false
      }
    }
  }
}
</script>

<style lang="scss">
page {
  background-color: #f4f4f4;
  .u-tabs {
    background-color: #fff;
  }
  .content {
    .read {
      height: 20px;
      line-height: 20px;
      padding: 20px 0 15px;
      image {
        width: 18px;
        height: 18px;
        vertical-align: text-bottom;
      }
      text {
        margin-left: 10px;
        font-size: 14px;
        color: #818181;
      }
    }
  }
}
</style>
